package com.sunny.esdemo.pojo;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * 索引库对应的实体类
 */
@Document(indexName = "blog", shards = 5, replicas = 1)
public class Blog {
    @Id
    @Field(store = true, type = FieldType.Integer)
    private Integer id;
    @Field(type = FieldType.Text, store = true, analyzer = "ik_max_word")
    private String title;
    @Field(type = FieldType.Text, store = true, analyzer = "ik_max_word")
    private String content;
    @Field(type = FieldType.Text, store = true, analyzer = "ik_max_word")
    private String comment;
    @Field(type = FieldType.Date, store = true)
    private String createTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }
}
